import {
  getBatchPlanByPage,
  addBatchPlan,
  updateBatchPlan,
  delBatchPlan,
  exportBatchPlan,
} from '@/services/project/batchPlan';
import { PlusOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import type { ActionType, ProColumns } from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table';
import { Button, Form, Input, message, Modal, Tree } from 'antd';
import { sortTran, filterTran } from '@/utils/requestUtil';
import React, { useEffect, useRef, useState } from 'react';
import Search from 'antd/lib/transfer/search';
const BatchPlan: React.FC<{}> = (props) => {
  const actionRef = useRef<ActionType>();
  const [modalVisit, setModalVisit] = useState(false); // 新建和编辑提示框
  const [confirmLoading, setConfirmLoading] = useState(false); //编辑框的disable
  const [formTitle, setFormTitle] = useState('新建'); //
  const [createOrUpdate, setCreateOrUpdate] = useState(false); //编辑框的disable
  const [form] = Form.useForm();
  const ref = useRef(null);
  const columns: ProColumns[] = [
    {
      title: '序号',
      dataIndex: 'index',
      valueType: 'index',
      width: 80,
      search: false,
    },

    {
      title: '项目名称',
      dataIndex: 'projectName',
      width: 150,
      align: 'center',
      sorter: true,
    },
    {
      title: '交付日期',
      dataIndex: 'batchDeliveryDate',
      valueType: 'date',
      search: false,
      width: 90,
    },
    {
      title: '当前批次',
      dataIndex: 'currentBatch',
      width: 90,
      search: false,
      align: 'center',
      sorter: true,
      render: (text, record) => (
        <div>
          {text}/{record.batchCount}
        </div>
      ),
    },
    {
      title: '当前状态',
      dataIndex: 'state',
      width: 105,
      search: false,
      align: 'center',
      sorter: true,
    },
    {
      title: '计划开工开始',
      dataIndex: 'planKickoffStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划开工结束',
      dataIndex: 'planKickoffEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划开工周期',
      dataIndex: 'planKickoffPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },

    {
      title: '实际开工开始',
      dataIndex: 'actualKickoffStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际开工结束',
      dataIndex: 'actualKickoffEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际开工周期',
      dataIndex: 'actualKickoffPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划设计开始',
      dataIndex: 'planDesignStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划设计结束',
      dataIndex: 'planDesignEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划设计周期',
      dataIndex: 'planDesignPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际设计开始',
      dataIndex: 'actualDesignStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际设计结束',
      dataIndex: 'actualDesignEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际设计周期',
      dataIndex: 'actualDesignPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划采购开始',
      dataIndex: 'planPurchaseStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划采购结束',
      dataIndex: 'planPurchaseEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划采购周期',
      dataIndex: 'planPurchasePeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际采购开始',
      dataIndex: 'actualPurchaseStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际采购结束',
      dataIndex: 'actualPurchaseEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际采购周期',
      dataIndex: 'actualPurchasePeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划请料开始',
      dataIndex: 'planLogisticStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划请料结束',
      dataIndex: 'planLogisticEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划请料周期',
      dataIndex: 'planLogisticPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际请料开始',
      valueType: 'date',
      dataIndex: 'actualLogisticStartDate',
      search: false,
      width: 110,
    },
    {
      title: '实际请料结束',
      dataIndex: 'actualLogisticEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际请料周期',
      dataIndex: 'actualLogisticPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划生产开始',
      dataIndex: 'planOrderStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划生产结束',
      dataIndex: 'planOrderEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划生产周期',
      dataIndex: 'planOrderPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际生产开始',
      dataIndex: 'actualOrderStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际生产结束',
      dataIndex: 'actualOrderEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际生产周期',
      dataIndex: 'actualOrderPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划入库开始',
      dataIndex: 'planInboundStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划入库结束',
      dataIndex: 'planInboundEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划入库周期',
      dataIndex: 'planInboundPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },

    {
      title: '实际入库开始',
      dataIndex: 'actualInboundStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际入库结束',
      dataIndex: 'actualInboundEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际入库周期',
      dataIndex: 'actualInboundPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划打包开始',
      dataIndex: 'planPackStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划打包结束',
      dataIndex: 'planPackEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划打包周期',
      dataIndex: 'planPackPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },

    {
      title: '实际打包开始',
      dataIndex: 'actualPackStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际打包结束',
      dataIndex: 'actualPackEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际打包周期',
      dataIndex: 'actualPackPeriod',
      valueType: 'date',
      width: 110,
      search: false,
    },
    {
      title: '计划交货开始',
      dataIndex: 'planDeliveryStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划交货结束',
      dataIndex: 'planDeliveryEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划交货周期',
      dataIndex: 'planDeliveryPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际交货开始',
      dataIndex: 'actualDeliveryStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际交货结束',
      dataIndex: 'actualDeliveryEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际交货周期',
      dataIndex: 'actualDeliveryPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划签收开始',
      dataIndex: 'planReceiptStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划签收结束',
      dataIndex: 'planReceiptEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },

    {
      title: '计划签收周期',
      dataIndex: 'planReceiptPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际签收开始',
      dataIndex: 'actualReceiptStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际签收结束',
      dataIndex: 'actualReceiptEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际签收周期',
      dataIndex: 'actualReceiptPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划安装开始',
      width: 110,
      dataIndex: 'planInstallStartDate',
      search: false,
      valueType: 'date',
    },
    {
      title: '计划安装结束',
      dataIndex: 'planInstallEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划安装周期',
      dataIndex: 'planInstallPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际安装开始',
      dataIndex: 'actualInstallStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际安装结束',
      dataIndex: 'actualInstallEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际安装周期',
      dataIndex: 'actualInstallPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划调试开始',
      dataIndex: 'planCommissionStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划调试结束',
      dataIndex: 'planCommissionEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划调试周期',
      dataIndex: 'planCommissionPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际调试开始',
      width: 110,
      dataIndex: 'actualCommissionStartDate',
      search: false,
      valueType: 'date',
    },
    {
      title: '实际调试结束',
      dataIndex: 'actualCommissionEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际调试周期',
      dataIndex: 'actualCommissionPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划验收开始',
      dataIndex: 'planFacStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划验收结束',
      dataIndex: 'planFacEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '计划验收周期',
      dataIndex: 'planFacPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际验收开始',
      dataIndex: 'actualFacStartDate',
      valueType: 'date',
      search: false,
      width: 110,
    },

    {
      title: '实际验收结束',
      dataIndex: 'actualFacEndDate',
      valueType: 'date',
      search: false,
      width: 110,
    },
    {
      title: '实际验收周期',
      dataIndex: 'actualFacPeriod',
      valueType: 'date',
      search: false,
      width: 110,
    },
    // {
    //   title: '备注',
    //   dataIndex: 'memo',
    //   search: false,
    //   width: 110,
    // },
    // {
    //   title: '预留',
    //   dataIndex: 'reserved',
    //   search: false,
    //   width: 110,
    // },
    // {
    //   title: '流水号',
    //   dataIndex: 'serialNo',
    //   search: false,
    //   width: 110,
    // },
    {
      title: '创建日期', //表头显示的名称
      search: false,
      dataIndex: 'createTime',
      valueType: 'date',
      width: 90,
    },
    {
      title: '创建人', //表头显示的名称
      search: false,
      dataIndex: 'createName',
      width: 90,
    },
    // {
    //   title: '操作',
    //   valueType: 'option',
    //   key: 'option',
    //   fixed: 'right',
    //   render: (text, record, _, action) => [
    //     <a
    //       key="editKey"
    //       onClick={() => {
    //         setModalVisit(true);
    //         setCreateOrUpdate(true);
    //         setFormTitle('编辑');
    //         form.setFieldsValue({
    //           actualCommissionEndDate: record.actualCommissionEndDate,
    //           actualCommissionPeriod: record.actualCommissionPeriod,
    //           actualCommissionStartDate: record.actualCommissionStartDate,
    //           actualDeliveryEndDate: record.actualDeliveryEndDate,
    //           actualDeliveryPeriod: record.actualDeliveryPeriod,
    //           actualDeliveryStartDate: record.actualDeliveryStartDate,
    //           actualDesignEndDate: record.actualDesignEndDate,
    //           actualDesignPeriod: record.actualDesignPeriod,
    //           actualDesignStartDate: record.actualDesignStartDate,
    //           actualFacEndDate: record.actualFacEndDate,
    //           actualFacPeriod: record.actualFacPeriod,
    //           actualFacStartDate: record.actualFacStartDate,
    //           actualInboundEndDate: record.actualInboundEndDate,
    //           actualInboundPeriod: record.actualInboundPeriod,
    //           actualInboundStartDate: record.actualInboundStartDate,
    //           actualInstallEndDate: record.actualInstallEndDate,
    //           actualInstallPeriod: record.actualInstallPeriod,
    //           actualInstallStartDate: record.actualInstallStartDate,
    //           actualKickoffEndDate: record.actualKickoffEndDate,
    //           actualKickoffPeriod: record.actualKickoffPeriod,
    //           actualKickoffStartDate: record.actualKickoffStartDate,
    //           actualLogisticEndDate: record.actualLogisticEndDate,
    //           actualLogisticPeriod: record.actualLogisticPeriod,
    //           actualLogisticStartDate: record.actualLogisticStartDate,
    //           actualOrderEndDate: record.actualOrderEndDate,
    //           actualOrderPeriod: record.actualOrderPeriod,
    //           actualOrderStartDate: record.actualOrderStartDate,
    //           actualPackEndDate: record.actualPackEndDate,
    //           actualPackPeriod: record.actualPackPeriod,
    //           actualPackStartDate: record.actualPackStartDate,
    //           actualPurchaseEndDate: record.actualPurchaseEndDate,
    //           actualPurchasePeriod: record.actualPurchasePeriod,
    //           actualPurchaseStartDate: record.actualPurchaseStartDate,
    //           actualReceiptEndDate: record.actualReceiptEndDate,
    //           actualReceiptPeriod: record.actualReceiptPeriod,
    //           actualReceiptStartDate: record.actualReceiptStartDate,
    //           batchDeliveryDate: record.batchDeliveryDate,
    //           batchPlanCode: record.batchPlanCode,
    //           isReleased: record.isReleased,
    //           memo: record.memo,
    //           planCommissionEndDate: record.planCommissionEndDate,
    //           planCommissionPeriod: record.planCommissionPeriod,
    //           planCommissionStartDate: record.planCommissionStartDate,
    //           planDeliveryEndDate: record.planDeliveryEndDate,
    //           planDeliveryPeriod: record.planDeliveryPeriod,
    //           planDeliveryStartDate: record.planDeliveryStartDate,
    //           planDesignEndDate: record.planDesignEndDate,
    //           planDesignPeriod: record.planDesignPeriod,
    //           planDesignStartDate: record.planDesignStartDate,
    //           planFacEndDate: record.planFacEndDate,
    //           planFacPeriod: record.planFacPeriod,
    //           planFacStartDate: record.planFacStartDate,
    //           planInboundEndDate: record.planInboundEndDate,
    //           planInboundPeriod: record.planInboundPeriod,
    //           planInboundStartDate: record.planInboundStartDate,
    //           planInstallEndDate: record.planInstallEndDate,
    //           planInstallPeriod: record.planInstallPeriod,
    //           planInstallStartDate: record.planInstallStartDate,
    //           planKickoffEndDate: record.planKickoffEndDate,
    //           planKickoffPeriod: record.planKickoffPeriod,
    //           planKickoffStartDate: record.planKickoffStartDate,
    //           planLogisticEndDate: record.planLogisticEndDate,
    //           planLogisticPeriod: record.planLogisticPeriod,
    //           planLogisticStartDate: record.planLogisticStartDate,
    //           planOrderEndDate: record.planOrderEndDate,
    //           planOrderPeriod: record.planOrderPeriod,
    //           planOrderStartDate: record.planOrderStartDate,
    //           planPackEndDate: record.planPackEndDate,
    //           planPackPeriod: record.planPackPeriod,
    //           planPackStartDate: record.planPackStartDate,
    //           planPurchaseEndDate: record.planPurchaseEndDate,
    //           planPurchasePeriod: record.planPurchasePeriod,
    //           planPurchaseStartDate: record.planPurchaseStartDate,
    //           planReceiptEndDate: record.planReceiptEndDate,
    //           planReceiptPeriod: record.planReceiptPeriod,
    //           planReceiptStartDate: record.planReceiptStartDate,
    //           reserved: record.reserved,
    //           serialNo: record.serialNo,
    //           masterPlanId: record.masterPlanId,
    //           currentBatch: record.currentBatch,
    //           batchCount: record.batchCount,
    //           infoId: record.infoId,
    //           projectName: record.projectName,
    //           id: record.id,
    //         });
    //       }}
    //     >
    //       编辑
    //     </a>,
    //     <a
    //       key="deleteKey"
    //       onClick={() => {
    //         Modal.confirm({
    //           title: '删除',
    //           content: '确定要删除吗',
    //           okText: '确认',
    //           cancelText: '取消',
    //           onOk: async () => {
    //             await delBatchPlan({ id: record.id });
    //             actionRef.current.reload();
    //           },
    //         });
    //       }}
    //     >
    //       删除
    //     </a>,
    //   ],
    // },
  ];
  //默认属性
  BatchPlan.defaultProps = {
    batchFlag: true,
  };
  const batchFlag = props.batchFlag;
  const handleSubmit = async () => {
    setConfirmLoading(true);
    if (formTitle == '新建') {
      const result = await addBatchPlan(form.getFieldsValue());
      if (result != null) {
        message.success('添加成功');
      }
    } else {
      await updateBatchPlan(form.getFieldsValue());
    }
    setConfirmLoading(false);
    setModalVisit(false);
    actionRef.current.reload();
  };

  return (
    <PageHeaderWrapper title={false} breadcrumb={undefined}>
      <ProTable
        headerTitle="项目进度查询"
        actionRef={actionRef} //用于触发刷新操作等，看api
        rowKey="id" //表格行 key 的取值，可以是字符串或一个函数
        formRef={ref}
        search={batchFlag}
        toolBarRender={(action, { selectedRows }) => [
          // <Button
          //   key="button"
          //   icon={<PlusOutlined />}
          //   onClick={() => {
          //     setCreateOrUpdate(false);
          //     setFormTitle('新建');
          //     form.resetFields();
          //     setModalVisit(true);
          //   }}
          //   type="primary"
          // >
          //   新建
          // </Button>,
          <Button
            key="button"
            icon={<PlusOutlined />}
            onClick={() => {
              const filters = filterTran(ref.current.getFieldsValue());
              exportBatchPlan({
                current: 1,
                pageSize: 5000,
                filters: filters,
              }).then((res) => {
                const aLink = document.createElement('a');
                document.body.appendChild(aLink);
                aLink.style.display = 'none';
                aLink.href = window.URL.createObjectURL(res);
                aLink.setAttribute('download', `BatchPlan.xlsx`);
                aLink.click();
                document.body.removeChild(aLink);
              });
            }}
            type="primary"
          >
            导出
          </Button>,
        ]}
        request={async (params = {}, sort, filter) => {
          const sorters = sortTran(sort);
          const filters = filterTran(params);
          const result = await getBatchPlanByPage({
            ...params,
            sorters: sorters,
            filters: filters,
          });

          return {
            data: result.data.content,
            total: result.data.totalElements,
            success: result.success,
          };
        }}
        columns={columns}
        scroll={{ x: 2000, y: 350 }}
        rowSelection={{}}
      />
      <Modal
        title={formTitle}
        visible={modalVisit}
        onOk={handleSubmit}
        confirmLoading={confirmLoading}
        onCancel={() => setModalVisit(false)}
      >
        <Form
          name="wrap"
          labelCol={{ flex: '110px' }}
          labelAlign="left"
          labelWrap
          form={form}
          wrapperCol={{ flex: 1 }}
          colon={false}
        >
          <Form.Item label="id" name="id" hidden={true}>
            <Input />
          </Form.Item>
          <Form.Item
            label="调试结束"
            name="actualCommissionEndDate"
            rules={[{ required: true, message: 'Please input your actualCommissionEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="调试周期"
            name="actualCommissionPeriod"
            rules={[{ required: true, message: 'Please input your actualCommissionPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="调试开始"
            name="actualCommissionStartDate"
            rules={[{ required: true, message: 'Please input your actualCommissionStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="交货结束"
            name="actualDeliveryEndDate"
            rules={[{ required: true, message: 'Please input your actualDeliveryEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="交货周期"
            name="actualDeliveryPeriod"
            rules={[{ required: true, message: 'Please input your actualDeliveryPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="交货开始"
            name="actualDeliveryStartDate"
            rules={[{ required: true, message: 'Please input your actualDeliveryStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="设计结束"
            name="actualDesignEndDate"
            rules={[{ required: true, message: 'Please input your actualDesignEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="设计周期"
            name="actualDesignPeriod"
            rules={[{ required: true, message: 'Please input your actualDesignPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="设计开始"
            name="actualDesignStartDate"
            rules={[{ required: true, message: 'Please input your actualDesignStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="验收结束"
            name="actualFacEndDate"
            rules={[{ required: true, message: 'Please input your actualFacEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="验收周期"
            name="actualFacPeriod"
            rules={[{ required: true, message: 'Please input your actualFacPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="验收开始"
            name="actualFacStartDate"
            rules={[{ required: true, message: 'Please input your actualFacStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="入库结束"
            name="actualInboundEndDate"
            rules={[{ required: true, message: 'Please input your actualInboundEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="入库周期"
            name="actualInboundPeriod"
            rules={[{ required: true, message: 'Please input your actualInboundPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="入库开始"
            name="actualInboundStartDate"
            rules={[{ required: true, message: 'Please input your actualInboundStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="安装结束"
            name="actualInstallEndDate"
            rules={[{ required: true, message: 'Please input your actualInstallEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="安装周期"
            name="actualInstallPeriod"
            rules={[{ required: true, message: 'Please input your actualInstallPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="安装开始"
            name="actualInstallStartDate"
            rules={[{ required: true, message: 'Please input your actualInstallStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="开工结束"
            name="actualKickoffEndDate"
            rules={[{ required: true, message: 'Please input your actualKickoffEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="开工周期"
            name="actualKickoffPeriod"
            rules={[{ required: true, message: 'Please input your actualKickoffPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="开工开始"
            name="actualKickoffStartDate"
            rules={[{ required: true, message: 'Please input your actualKickoffStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="请料结束"
            name="actualLogisticEndDate"
            rules={[{ required: true, message: 'Please input your actualLogisticEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="请料周期"
            name="actualLogisticPeriod"
            rules={[{ required: true, message: 'Please input your actualLogisticPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="请料开始"
            name="actualLogisticStartDate"
            rules={[{ required: true, message: 'Please input your actualLogisticStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="生产结束"
            name="actualOrderEndDate"
            rules={[{ required: true, message: 'Please input your actualOrderEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="生产周期"
            name="actualOrderPeriod"
            rules={[{ required: true, message: 'Please input your actualOrderPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="生产开始"
            name="actualOrderStartDate"
            rules={[{ required: true, message: 'Please input your actualOrderStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="打包结束"
            name="actualPackEndDate"
            rules={[{ required: true, message: 'Please input your actualPackEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="打包周期"
            name="actualPackPeriod"
            rules={[{ required: true, message: 'Please input your actualPackPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="打包开始"
            name="actualPackStartDate"
            rules={[{ required: true, message: 'Please input your actualPackStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="采购结束"
            name="actualPurchaseEndDate"
            rules={[{ required: true, message: 'Please input your actualPurchaseEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="采购周期"
            name="actualPurchasePeriod"
            rules={[{ required: true, message: 'Please input your actualPurchasePeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="采购开始"
            name="actualPurchaseStartDate"
            rules={[{ required: true, message: 'Please input your actualPurchaseStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="签收结束"
            name="actualReceiptEndDate"
            rules={[{ required: true, message: 'Please input your actualReceiptEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="签收周期"
            name="actualReceiptPeriod"
            rules={[{ required: true, message: 'Please input your actualReceiptPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="签收开始"
            name="actualReceiptStartDate"
            rules={[{ required: true, message: 'Please input your actualReceiptStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="交货日期"
            name="batchDeliveryDate"
            rules={[{ required: true, message: 'Please input your batchDeliveryDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="计划编号"
            name="batchPlanCode"
            rules={[{ required: true, message: 'Please input your batchPlanCode!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="是否发布"
            name="isReleased"
            rules={[{ required: true, message: 'Please input your isReleased!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="备注"
            name="memo"
            rules={[{ required: true, message: 'Please input your memo!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="调试结束"
            name="planCommissionEndDate"
            rules={[{ required: true, message: 'Please input your planCommissionEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="调试周期"
            name="planCommissionPeriod"
            rules={[{ required: true, message: 'Please input your planCommissionPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="调试开始"
            name="planCommissionStartDate"
            rules={[{ required: true, message: 'Please input your planCommissionStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="交货结束"
            name="planDeliveryEndDate"
            rules={[{ required: true, message: 'Please input your planDeliveryEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="交货周期"
            name="planDeliveryPeriod"
            rules={[{ required: true, message: 'Please input your planDeliveryPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="交货开始"
            name="planDeliveryStartDate"
            rules={[{ required: true, message: 'Please input your planDeliveryStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="设计结束"
            name="planDesignEndDate"
            rules={[{ required: true, message: 'Please input your planDesignEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="设计周期"
            name="planDesignPeriod"
            rules={[{ required: true, message: 'Please input your planDesignPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="设计开始"
            name="planDesignStartDate"
            rules={[{ required: true, message: 'Please input your planDesignStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="验收结束"
            name="planFacEndDate"
            rules={[{ required: true, message: 'Please input your planFacEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="验收周期"
            name="planFacPeriod"
            rules={[{ required: true, message: 'Please input your planFacPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="验收开始"
            name="planFacStartDate"
            rules={[{ required: true, message: 'Please input your planFacStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="入库结束"
            name="planInboundEndDate"
            rules={[{ required: true, message: 'Please input your planInboundEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="入库周期"
            name="planInboundPeriod"
            rules={[{ required: true, message: 'Please input your planInboundPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="入库开始"
            name="planInboundStartDate"
            rules={[{ required: true, message: 'Please input your planInboundStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="安装结束"
            name="planInstallEndDate"
            rules={[{ required: true, message: 'Please input your planInstallEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="安装周期"
            name="planInstallPeriod"
            rules={[{ required: true, message: 'Please input your planInstallPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="安装开始"
            name="planInstallStartDate"
            rules={[{ required: true, message: 'Please input your planInstallStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="开工结束"
            name="planKickoffEndDate"
            rules={[{ required: true, message: 'Please input your planKickoffEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="开工周期"
            name="planKickoffPeriod"
            rules={[{ required: true, message: 'Please input your planKickoffPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="开工开始"
            name="planKickoffStartDate"
            rules={[{ required: true, message: 'Please input your planKickoffStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="请料结束"
            name="planLogisticEndDate"
            rules={[{ required: true, message: 'Please input your planLogisticEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="请料周期"
            name="planLogisticPeriod"
            rules={[{ required: true, message: 'Please input your planLogisticPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="请料开始"
            name="planLogisticStartDate"
            rules={[{ required: true, message: 'Please input your planLogisticStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="生产结束"
            name="planOrderEndDate"
            rules={[{ required: true, message: 'Please input your planOrderEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="生产周期"
            name="planOrderPeriod"
            rules={[{ required: true, message: 'Please input your planOrderPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="生产开始"
            name="planOrderStartDate"
            rules={[{ required: true, message: 'Please input your planOrderStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="打包结束"
            name="planPackEndDate"
            rules={[{ required: true, message: 'Please input your planPackEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="打包周期"
            name="planPackPeriod"
            rules={[{ required: true, message: 'Please input your planPackPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="打包开始"
            name="planPackStartDate"
            rules={[{ required: true, message: 'Please input your planPackStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="采购结束"
            name="planPurchaseEndDate"
            rules={[{ required: true, message: 'Please input your planPurchaseEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="采购周期"
            name="planPurchasePeriod"
            rules={[{ required: true, message: 'Please input your planPurchasePeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="采购开始"
            name="planPurchaseStartDate"
            rules={[{ required: true, message: 'Please input your planPurchaseStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="签收结束"
            name="planReceiptEndDate"
            rules={[{ required: true, message: 'Please input your planReceiptEndDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="签收周期"
            name="planReceiptPeriod"
            rules={[{ required: true, message: 'Please input your planReceiptPeriod!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="签收开始"
            name="planReceiptStartDate"
            rules={[{ required: true, message: 'Please input your planReceiptStartDate!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="预留"
            name="reserved"
            rules={[{ required: true, message: 'Please input your reserved!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="流水号"
            name="serialNo"
            rules={[{ required: true, message: 'Please input your serialNo!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="主计划id"
            name="masterPlanId"
            rules={[{ required: true, message: 'Please input your masterPlanId!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="当前批次"
            name="currentBatch"
            rules={[{ required: true, message: 'Please input your currentBatch!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="批次总数"
            name="batchCount"
            rules={[{ required: true, message: 'Please input your batchCount!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="项目id"
            name="infoId"
            rules={[{ required: true, message: 'Please input your infoId!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
          <Form.Item
            label="项目名称"
            name="projectName"
            rules={[{ required: true, message: 'Please input your projectName!' }]}
          >
            <Input disabled={createOrUpdate} />
          </Form.Item>
        </Form>
      </Modal>
    </PageHeaderWrapper>
  );
};
export default BatchPlan;
